package com.wc.AlgoOJ_homework.AlgoOJ_BL4.B_2023;

/**
 * @Author congge
 * @Date 2024/4/6 9:16
 * @description http://43.138.190.70:8888/p/LQ1404?tid=660a4f84d7ba43eb2f4c549d
 */
public class Main {
    public static void main(String[] args) {
        int start = 12345678;
        int end = 98765432;
        int res = 0;
        for (int i = start; i <= end; i++) {
            if (isExist2023(i)){
                res++;
            }
        }
        System.out.println(end - start + 1 - res);
    }

    static int[] c = new int[]{3, 2, 0, 2};

    static boolean isExist2023(int n) {
        int idx = 0;
        while (n > 0) {
            if (n % 10 == c[idx]) {
                idx++;
                if (idx == 4) return true;
            }
            n /= 10;
        }
        return false;
    }
}
